package com.project.controller;

import com.project.bean.MonthCountBean;
import com.project.bean.SaleCartBean;
import com.project.bean.UserBean;
import com.project.service.IMonthCountService;
import com.project.service.ISaleCartService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@RestController
@RequestMapping("monthCount")
@Api(tags = "月统计")
public class MonthCountController {
    @Autowired
    private IMonthCountService monthCountService;

    @ApiOperation(value = "查询销售记录拥有的年份")
    @GetMapping("findYear")
    public List<String> findYear() {
        return monthCountService.findYear();
    }

    @ApiOperation(value = "查询类别销售总额")
    @GetMapping("countTotal")
    public List<MonthCountBean> countTotal(String year) {
        return monthCountService.countTotal(year);
    }



}
